// XMLManager.h: interface for the XMLManager class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_XMLMANAGER_H__59AD5F4A_7F5B_4541_8F9B_47CE4EADE508__INCLUDED_)
#define AFX_XMLMANAGER_H__59AD5F4A_7F5B_4541_8F9B_47CE4EADE508__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include "xml.h"
#include "StructureAndConst.h"

class XMLManager  
{
public:
	XMLManager();
	virtual ~XMLManager();
	static bool Initialize();
	static void Uninitialize();
	//BalloonMap.xml
	static vector<GameMapType_t> m_listGameMapTypes;

	//BalloonElemnet.xml
	static vector<BalloonElemnet_t> m_vecBackGrounds;
	static vector<BalloonElemnet_t> m_vecStaticElements;
	static vector<BalloonElemnet_t> m_vecPlayerBases;
	static vector<BalloonElemnet_t> m_vecVanes;
	static vector<BalloonElemnet_t> m_vecSpouts;
	static vector<BalloonElemnet_t> m_vecFloats;
	//static vector<BalloonElemnet_t> m_vecPlayers;
	static vector<BalloonElemnet_t> m_vecFlyElements;
	static vector<BalloonElemnet_t> m_vecPrimers;
	static vector<BalloonElemnet_t> m_vecGates;
	static vector<BalloonElemnet_t> m_vecTraps;
	static vector<BalloonElemnet_t> m_vecStabbers;
	static vector<BalloonElemnet_t> m_vecBarriers;
	static vector<BalloonElemnet_t> m_vecProperties;

	//BalloonPic.xml
	static vector<vector<Pic_t> >  m_vecPic;

	//BalloonItemPic.xml
	static vector<vector<BalloonItemPic_t> >  m_vecBalloonItemPic;
private:

	static bool InitMap();

	//read BalloonMap.xml
	static bool ReadMaps( CXml xml, const CString& csMapName, GameMapType_t &stGameMapType );
	static bool ReadElements(CXmlNode *pMapNode,GameMap*& pGameMap,int nOffsetX,int nOffsetY);
	static bool ReadStaticElementInMap(const CString &csElementName, const CString& csElementsName, 
		CXmlNode *pParentNode, list<Static_Element_InMap_t> &listElements,int nOffsetX,int nOffsetY);
	static bool ReadPropertiesInMap(const CString &csElementName, const CString& csElementsName, 
		CXmlNode *pParentNode, list<Property_InMap_t> &listElements);
	static bool ReadFlyElementInMap(const CString &csElementName, const CString& csElementsName, 
		CXmlNode *pParentNode, list<Fly_Element_InMap_t> &listElements,int nOffsetX,int nOffsetY);

	//read BalloonElemnet.xml
	static bool InitBalloonElement();
	static bool ReadBalloonElements(CXml xmlBalloonEle,const CString &csElementName, const CString& csElementsName,vector<BalloonElemnet_t>& vecElements);

	//read BalloonPic.xml
	static bool InitBalloonPic();

	//read BalloonItemPic.xml
	static bool InitBalloonItemPic();

};

#endif // !defined(AFX_XMLMANAGER_H__59AD5F4A_7F5B_4541_8F9B_47CE4EADE508__INCLUDED_)
